package com;

import java.util.ArrayList;
import java.util.List;

import com.lang.String22;

public class TestClone {
	/*
	 * public void test(MyClone myClone){ MyClone oldObject = null; MyClone
	 * newObject = null; MyCloneSub temp=(MyCloneSub)myClone; newObject = temp;
	 * oldObject = (MyCloneSub)temp.clone();
	 * 
	 * if(newObject instanceof MyCloneSub){ System.out.println("True"); }
	 * 
	 * if(oldObject instanceof MyCloneSub){ System.out.println("True"); }
	 * 
	 * System.out.println("myClone2 equals myClone1: " +
	 * oldObject.equals(newObject)); }
	 */

	public static void main(String[] args) throws CloneNotSupportedException {

		// TestClone test = new TestClone();

		/*
		 * MyClone myClone1 = new MyClone(null, null);
		 * System.out.println(myClone1.getHardEnum());
		 * System.out.println(myClone1.getName());
		 * System.out.println(SlightEnum.Saved.getId());
		 * System.out.println(SlightEnum.Saved.equals("Saved"));
		 * System.out.println(SlightEnum.Saved == SlightEnum.Saved);
		 */

		/*
		 * int p = 2; for (int i = 0; i < 3; i++) { if (p < 1) {
		 * System.out.println("dongdong"); } else continue; }
		 */

		/*MyClone1 listClone = new MyClone1(null, null);
		FareClassOcc fccc = new FareClassOcc();
		fccc.setTicketCode("feifei");
		List<SringOcc> sringOcc = new ArrayList<SringOcc>();
		sringOcc.add(fccc);
		listClone.setStringOcc(sringOcc);

		MyClone1 listCloneCopy = listClone.clone();

		for (SringOcc scc : listCloneCopy.getStringOcc()) {
			System.out.println(scc.getValue());
		}*/
		
		MyClone1 listClone1 = new MyClone1(null, null);
		
		FareClassOcc fccc1 = new FareClassOcc();
		fccc1.setTicketCode("feifei");
		String22 string22 = new String22();
		string22.setDong("dong");
		fccc1.setString22(string22);
		listClone1.setFareOcc(fccc1);
		
		List<SringOcc> sringOcc1= new ArrayList<SringOcc>();
		sringOcc1.add(fccc1);
		listClone1.setStringOcc(sringOcc1);
		
		MyClone1 listCloneCopy1 = listClone1.clone();
		for (SringOcc scc : listCloneCopy1.getStringOcc()) {
			System.out.println(scc.getValue());
		}
		System.out.println(listCloneCopy1.getFareOcc().getValue());
		System.out.println(listCloneCopy1.getFareOcc().getString22().getDong());
		
		/*
		 * MyClone myClone1 = new MyCloneSub("clone1"); MyClone myClone2 =
		 * (MyClone)myClone1.clone();
		 * 
		 * if(myClone1 instanceof MyCloneSub){ System.out.println("True"); }
		 * 
		 * if (myClone2 != null) { System.out.println(myClone2.getName());
		 * System.out.println("myClone2 equals myClone1: " +
		 * myClone2.equals(myClone1)); } else {
		 * System.out.println("Clone Not Supported"); }
		 */
	}
}



/*
 * class MyCloneSub extends MyClone implements Cloneable{ public String test;
 * public MyCloneSub(String name) { super(name); this.test = "zhang"; }
 * 
 * @Override //override the object.clone method public Object clone() { try {
 * return super.clone(); } catch (CloneNotSupportedException e) { return null; }
 * }
 * 
 * // the other way to invoke the clone method public MyCloneSub invokeClone(){
 * return (MyCloneSub)this.clone(); } }
 * 
 * class MyCloneSub1 extends MyClone{ public MyCloneSub1(String name) {
 * super(name); } }
 */